<?php

namespace Lib\Core;

use Workerman\Worker;

class Server {

    public static $workManDir = '';

    public static function run($configFile) {

        $conf = require $configFile;

        require_once $conf['workman_dir'] . '/Autoloader.php';

        $worker = new Worker($conf['uri']);

        foreach ($conf['worker'] as $key => $value) {
            $worker->$key = $value;
        }

        Worker::runAll();
    }
}